package com.eaoa.uc.busroute.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.eaoa.base.EABaseAction;
import com.eaoa.constants.AttachmentConstants;
import com.eaoa.query.bus.BusRouteQuery;
import com.eaoa.uc.busroute.form.BusRouteForm;
import com.eaoa.utils.AttachmentUtils;
import com.eaoa.vo.bus.BusRoute;
import com.stony.core.util.CoreUtils;

public class BusRouteModifyPreAction extends EABaseAction {

	protected ActionForward doWork(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		BusRouteForm myform = (BusRouteForm) form;
		
		Long id = CoreUtils.parseLong(myform.getRouteno());

		if (id!=null) {
			if (!isReEntry(request)) {
				BusRoute vo = BusRouteQuery.loadByNO(id);
				myform.setVO(vo);
			}
//			Map attachments = AttachmentUtils.getAttachmentMap(AttachmentConstants.ATTACHMENTTYPE_VEHICLE,id);
//			request.setAttribute("attachments", attachments);
		}else{
			
		}
		
		return mapping.findForward("success");

	}
}